package com.hqd.ch03.v50.beans.factory.support;

import com.hqd.ch03.v50.beans.factory.BeanCreationException;

public class ScopeNotActiveException extends BeanCreationException {

    /**
     * Create a new ScopeNotActiveException.
     *
     * @param beanName  the name of the bean requested
     * @param scopeName the name of the target scope
     * @param cause     the root cause, typically from {@link org.springframework.beans.factory.config.Scope#get}
     */
    public ScopeNotActiveException(String beanName, String scopeName, IllegalStateException cause) {
        super(beanName, "Scope '" + scopeName + "' is not active for the current thread; consider " +
                "defining a scoped proxy for this bean if you intend to refer to it from a singleton", cause);
    }

}
